MY_LOCAL_PATH := $(call my-dir)
OPENCV_LIBRARIES := libopencv_core-vspice \
					libopencv_legacy-vspice \
					libopencv_imgproc-vspice \
					libopencv_features2d-vspice \
					libopencv_calib3d-vspice \
					libopencv_contrib-vspice \
					libopencv_flann-vspice

include $(call all-subdir-makefiles)

include  $(CLEAR_VARS)
LOCAL_PATH := $(MY_LOCAL_PATH)
LOCAL_MODULE := vision-spice
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/spice
LOCAL_LDLIBS := -lm -llog -lz 
LOCAL_LDFLAGS := --start-group $(MY_LOCAL_PATH)/lib/libopencv_core.a \
	$(MY_LOCAL_PATH)/lib/libopencv_features2d.a \
	$(MY_LOCAL_PATH)/lib/libopencv_flann.a \
	$(MY_LOCAL_PATH)/lib/libopencv_contrib.a \
	$(MY_LOCAL_PATH)/lib/libopencv_calib3d.a \
	$(MY_LOCAL_PATH)/lib/libopencv_objdetect.a \
	$(MY_LOCAL_PATH)/lib/libopencv_imgproc.a \
	$(MY_LOCAL_PATH)/lib/libopencv_legacy.a \
	--end-group
LOCAL_SRC_FILES := VSpice_wrap.cpp VSpice.cpp\
				   Recognition.cpp DescWriter.cpp Analysis.cpp \
				   Element.cpp Wire.cpp yuv420sp2rgb.c ReadData.cpp
LOCAL_SHARED_LIBRARIES := spice
LOCAL_STATIC_LIBRARIES := $(OPENCV_LIBRARIES) 
include $(BUILD_SHARED_LIBRARY)
